package com.appsl.objects;

import com.google.android.gms.maps.model.LatLng;

public class Lugar
{
	private int idlugar;
	private String name;
	private double X;
	private double Y; 
	private String direccion;
		
	public Lugar() {

	}

	public Lugar(int idlugar, String name, String strX, String strY, String direccion) {
		this.idlugar = idlugar;
		this.name = name;
		X = Double.parseDouble(strX);
		Y = Double.parseDouble(strY);
		this.direccion = direccion;
	}

	public int getIdlugar() {
		return idlugar;
	}

	public void setIdlugar(int idlugar) {
		this.idlugar = idlugar;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getX() {
		return X;
	}

	public void setX(double x) {
		X = x;
	}

	public double getY() {
		return Y;
	}

	public void setY(double y) {
		Y = y;
	}

	public LatLng getPoint()
	{
		return new LatLng(X, Y);
	}
	
	public boolean checkIfMatch(String nm, String[] coords)
	{
		boolean match = true;
		
		if (!this.name.equals(nm))
		{
			match = false;
		}
		
		//This SHOULD be considered, but not now.
		//if (this.X != Double.parseDouble(coords[0]) || this.Y != Double.parseDouble(coords[1]))
		//{
		//	match = false;
		//}
		
		return match;
	}

	public String getDireccion() {
		return direccion;
	}

	public void setDireccion(String direccion) {
		this.direccion = direccion;
	}
}
